# zope imports
from zope.interface import Interface
from zope.interface import implements

# Five imports
from Products.Five.browser import BrowserView

# clickcounting imports
from iqpp.clickcounting.interfaces import IClickCounting

class IClickView(Interface):
    """
    """
    def getClicks():
        """Returns amount of clicks.
        """

    def getCounters():
        """Returns counters as a dict.
        """
        
    def countClick():
        """Count one click.
        """
    
class ClickView(BrowserView):
    """
    """
    def getClicks(self):
        """
        """
        cc = IClickCounting(self.context)
        return cc.getClicks()

    def getCounters(self):
        """
        """        
        cc = IClickCounting(self.context)
        return cc.getCounters()
        
    def countClick(self):
        """
        """
        cc = IClickCounting(self.context)
        cc.countClick()